<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for Mysqli.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file Mysqli.php</h1>
<p>Documentation is available at <a href="../default/_ays_application_model_Mysqli_php.html">Mysqli.php</a></p>
<div class="src-code">
<pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><a href="../default/_ays_application_function_protectScript_php.html#functionprotectScript">protectScript</a><span class="src-sym">(</span><span class="src-str">'Mysqli.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a3"></a>&nbsp;</li>
<li><a name="a4"></a><span class="src-key">class </span><a href="../default/AYSMysqli.html">AYSMysqli</a> <span class="src-key">extends </span><span class="src-id">mysqli</span><span class="src-sym">{</span></li>
<li><a name="a5"></a>    <span class="src-key">public </span><a href="../default/AYSMysqli.html#var$fTotalExecutionTime">$fTotalExecutionTime</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a6"></a>    <span class="src-key">public </span><a href="../default/AYSMysqli.html#var$iNumberQueries">$iNumberQueries</a> = <span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a7"></a>    <span class="src-key">public </span><a href="../default/AYSMysqli.html#var$aiasmTraceQueries">$aiasmTraceQueries</a> = <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a8"></a>    <span class="src-key">private </span><span class="src-key">static </span><span class="src-var">$oMysqliInstance</span><span class="src-sym">;</span></li>
<li><a name="a9"></a>    <span class="src-key">public </span><span class="src-key">static </span><span class="src-var">$iIdInsert</span><span class="src-sym">;</span></li>
<li><a name="a10"></a>&nbsp;</li>
<li><a name="a11"></a>    <span class="src-key">public </span><span class="src-key">function </span><a href="../default/AYSMysqli.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$sHost</span><span class="src-sym">, </span><span class="src-var">$sLogin</span><span class="src-sym">, </span><span class="src-var">$sPassword</span><span class="src-sym">, </span><span class="src-var">$sDatabase</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a12"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><span class="src-id">__construct</span><span class="src-sym">(</span><span class="src-var">$sHost</span><span class="src-sym">, </span><span class="src-var">$sLogin</span><span class="src-sym">, </span><span class="src-var">$sPassword</span><span class="src-sym">, </span><span class="src-var">$sDatabase</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a13"></a>&nbsp;</li>
<li><a name="a14"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">mysqli_connect_errno</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a15"></a>            throw <span class="src-key">new </span><span class="src-id"><a href="../default/MysqliConnexionException.html">MysqliConnexionException</a></span><span class="src-sym">(</span></li>
<li><a name="a16"></a>                <span class="src-str">'Une erreur a été rencontrée lors de l\'intéraction avec la base de données. L\'administrateur a été averti.'</span><span class="src-sym">,</span></li>
<li><a name="a17"></a>                <span class="src-id"><a href="../default/_ays_application_Exceptions_ExceptionsList_php.html#defineCRIT">CRIT</a></span><span class="src-sym">,</span></li>
<li><a name="a18"></a>                <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a19"></a>                    <span class="src-str">'Infos' </span>=&gt; <span class="src-str">'Server Error n&amp;deg;'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">errno</span>.<span class="src-str">' : '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span></li>
<li><a name="a20"></a>                <span class="src-sym">)</span></li>
<li><a name="a21"></a>            <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a22"></a>        <span class="src-sym">}</span></li>
<li><a name="a23"></a>    <span class="src-sym">}</span></li>
<li><a name="a24"></a>&nbsp;</li>
<li><a name="a25"></a>    <span class="src-key">public </span><span class="src-key">static </span><span class="src-key">function </span><a href="../default/AYSMysqli.html#methodgetInstance">getInstance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a26"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$oMysqliInstance</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a27"></a>            <span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$oMysqliInstance </span>= <span class="src-key">new </span><span class="src-id">AYSMysqli</span><span class="src-sym">(</span><span class="src-id"><a href="../default/_ays_config_config_php.html#defineBDD_HOST">BDD_HOST</a></span><span class="src-sym">, </span><span class="src-id"><a href="../default/_ays_config_config_php.html#defineBDD_USER">BDD_USER</a></span><span class="src-sym">, </span><span class="src-id"><a href="../default/_ays_config_config_php.html#defineBDD_PASS">BDD_PASS</a></span><span class="src-sym">, </span><span class="src-id"><a href="../default/_ays_config_config_php.html#defineBDD_DATABASE">BDD_DATABASE</a></span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a28"></a>        <span class="src-sym">}</span></li>
<li><a name="a29"></a>        <span class="src-key">return </span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$oMysqliInstance</span><span class="src-sym">;</span></li>
<li><a name="a30"></a>    <span class="src-sym">}</span></li>
<li><a name="a31"></a>&nbsp;</li>
<li><a name="a32"></a>    <span class="src-key">public </span><span class="src-key">function </span><a href="../default/AYSMysqli.html#methodquery">query</a><span class="src-sym">(</span><span class="src-var">$sQuery</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a33"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../default/AYSMysqli.html#var$aiasmTraceQueries">aiasmTraceQueries</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../default/AYSMysqli.html#var$iNumberQueries">iNumberQueries</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'sQuery'</span><span class="src-sym">] </span>= <span class="src-var">$sQuery</span><span class="src-sym">;</span></li>
<li><a name="a34"></a>&nbsp;</li>
<li><a name="a35"></a>        <span class="src-var">$fTimeAtExecution </span>= <span class="src-id">microtime</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a36"></a>&nbsp;</li>
<li><a name="a37"></a>        <span class="src-var">$rQueryResult </span>= <span class="src-id">parent</span><span class="src-sym">::</span><span class="src-id">query</span><span class="src-sym">(</span><span class="src-var">$sQuery</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a38"></a>&nbsp;</li>
<li><a name="a39"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$rQueryResult</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a40"></a>            throw <span class="src-key">new </span><span class="src-id"><a href="../default/MysqliExecutionException.html">MysqliExecutionException</a></span><span class="src-sym">(</span></li>
<li><a name="a41"></a>                <span class="src-str">'Une erreur a été rencontrée lors de l\'intéraction avec la base de données. L\'administrateur a été averti.'</span><span class="src-sym">,</span></li>
<li><a name="a42"></a>                <span class="src-id"><a href="../default/_ays_application_Exceptions_ExceptionsList_php.html#defineERROR">ERROR</a></span><span class="src-sym">,</span></li>
<li><a name="a43"></a>                <span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a44"></a>                    <span class="src-str">'Infos' </span>=&gt; <span class="src-str">'Server Error n°'</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">errno</span>.<span class="src-str">';Error: '</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span>.<span class="src-str">';Data: '</span>.<span class="src-var">$sQuery</span></li>
<li><a name="a45"></a>                <span class="src-sym">)</span></li>
<li><a name="a46"></a>            <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a47"></a>        <span class="src-sym">}</span></li>
<li><a name="a48"></a>&nbsp;</li>
<li><a name="a49"></a>        <span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$iIdInsert </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">insert_id</span><span class="src-sym">;</span></li>
<li><a name="a50"></a>&nbsp;</li>
<li><a name="a51"></a>        <span class="src-var">$fTimeOfExecution </span>= <span class="src-id">microtime</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">) </span>- <span class="src-var">$fTimeAtExecution</span><span class="src-sym">;</span></li>
<li><a name="a52"></a>&nbsp;</li>
<li><a name="a53"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../default/AYSMysqli.html#var$fTotalExecutionTime">fTotalExecutionTime</a> += <span class="src-var">$fTimeOfExecution</span><span class="src-sym">;</span></li>
<li><a name="a54"></a>&nbsp;</li>
<li><a name="a55"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../default/AYSMysqli.html#var$aiasmTraceQueries">aiasmTraceQueries</a><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../default/AYSMysqli.html#var$iNumberQueries">iNumberQueries</a><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'fTimeOfExecution'</span><span class="src-sym">] </span>= <span class="src-var">$fTimeOfExecution</span><span class="src-sym">;</span></li>
<li><a name="a56"></a>&nbsp;</li>
<li><a name="a57"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../default/AYSMysqli.html#var$iNumberQueries">iNumberQueries</a>++<span class="src-sym">;</span></li>
<li><a name="a58"></a>&nbsp;</li>
<li><a name="a59"></a>        <span class="src-key">return </span><span class="src-var">$rQueryResult</span><span class="src-sym">;</span></li>
<li><a name="a60"></a>    <span class="src-sym">}</span></li>
<li><a name="a61"></a><span class="src-sym">}</span></li>
</ol></pre>
</div>
	<p class="notes" id="credit">
		Documentation generated on Sun, 30 Mar 2008 00:13:53 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</body>
</html>